﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Excel = Microsoft.Office.Interop.Excel;
using System.IO;

namespace HExcelToXML
{
    class XExcelToXml
    {
        /*
         * Member Data
         */
        private System.String m_filename;
     
        /* ***********************************
         * Constructor
         * ***********************************/
        public XExcelToXml()
        {
        }

        /* **********************************
         * Public Function
         * **********************************/
        public EErrorCode setExcelFile (System.String filename)
        {
            if (filename == null)
                return EErrorCode.k_file_name_null;
            if (!File.Exists(filename))
                return EErrorCode.k_file_not_exist;
            if (Path.GetExtension(filename) != ".xls" &&
                Path.GetExtension(filename) != ".XLS")
                return EErrorCode.k_not_excel_file;   
            m_filename = filename;
            return 0;
        }

        public System.String getExcelFile()
        {
            return m_filename; //Caller needs to check null 
        }

        /* ****************************************
         * Virtual Function
         * ***************************************/
        public virtual EErrorCode parseExcel()
        {
            return 0;
        }
    }
}
